package db

const TableNameTypeProgrammeSource = TablePrefix + "type_programme_source"

type TypeProgrammeSource struct {
	BaseModel
	ProgrammeID uint  `gorm:"column:programme_id;type:int(11);default:0;comment:用户id" json:"programme_id" form:"programme_id"` // 用户id
	TypeID      uint  `gorm:"column:type_id;type:int(11);default:0;comment:类型id" json:"type_id" form:"type_id"`                // 消耗类型id
	Num         int64 `gorm:"column:num;type:int(11);default:0;comment:消耗数量" json:"num" form:"num"`                            // 消耗数量
	IsMj        int   `gorm:"column:is_mj;type:tinyint(1);default:0;comment:1=母舰" json:"is_mj" form:"is_mj"`                   // 1=母舰
}

func (*TypeProgrammeSource) TableName() string {
	return TableNameTypeProgrammeSource
}

type TypeProgrammeSourceHasOneType struct {
	TypeProgrammeSource
	TypeInfo Type `gorm:"foreignKey:ID;references:TypeID" json:"type_info"`
}
